package ah.file;
import java.io.File;
import java.io.FilenameFilter;

public class FileCopyFileFilter implements FilenameFilter {

	/**
	 * 文件过滤
	 * @param args
	 */
	public static void main(String[] args) {
		File file = new File("F:/jdk-1_5_0-src-jrl/j2se/src/share/classes/javax/xml");
		File[] files = file.listFiles(new FileCopyFileFilter());
		for (File file2 : files) {
			System.out.println(file2.getName());
		}
	}

	public boolean accept(File dir, String name) {
		File file = new File(dir.getAbsoluteFile()+"/"+name);
		if (file.isDirectory() || name.toLowerCase().endsWith(".ini")
				||name.toLowerCase().endsWith(".txt")
				||name.toLowerCase().endsWith(".java")
				||name.toLowerCase().endsWith(".html")
				||name.toLowerCase().endsWith(".htm")
				||name.toLowerCase().endsWith(".xml")
				||name.toLowerCase().endsWith(".jsp")
				) {
			return true;
		}
		
		return false;
	}

}
